import CustomSearchServer from './server';
import CustomSearchComponent from './index.vue';

const install = (app: any) => {
  CustomSearchComponent.TUIServer = CustomSearch.server;
  app.component(CustomSearch.name, CustomSearchComponent);
};

const plugin = (TUICore: any) => {
  (CustomSearch.server as any)  = new CustomSearchServer(TUICore);
  TUICore.component(CustomSearch.name, CustomSearch);
  return CustomSearch;
};

const CustomSearch = {
  name: 'CustomSearch',
  component: CustomSearchComponent,
  server: CustomSearchServer,
  install,
  plugin,
};

export default CustomSearch;
